3.228 \(\int \frac {\cot ^3(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=132 \[ -\frac {b^2 (3 a-2 b) \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 f (a-b)^2}-\frac {(a+2 b) \log (\tan (e+f x))}{a^3 f}+\frac {b^2}{2 a^2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac {\cot ^2(e+f x)}{2 a^2 f}-\frac {\log (\cos (e+f x))}{f (a-b)^2} \]

[Out]

-1/2*cot(f*x+e)^2/a^2/f-ln(cos(f*x+e))/(a-b)^2/f-(a+2*b)*ln(tan(f*x+e))/a^3/f-1/2*(3*a-2*b)*b^2*ln(a+b*tan(f*x
+e)^2)/a^3/(a-b)^2/f+1/2*b^2/a^2/(a-b)/f/(a+b*tan(f*x+e)^2)

________________________________________________________________________________________

Rubi [A]  time = 0.16, antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3670, 446, 88} \[ \frac {b^2}{2 a^2 f (a-b) \left (a+b \tan ^2(e+f x)\right )}-\frac {b^2 (3 a-2 b) \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 f (a-b)^2}-\frac {(a+2 b) \log (\tan (e+f x))}{a^3 f}-\frac {\cot ^2(e+f x)}{2 a^2 f}-\frac {\log (\cos (e+f x))}{f (a-b)^2} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^3/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-Cot[e + f*x]^2/(2*a^2*f) - Log[Cos[e + f*x]]/((a - b)^2*f) - ((a + 2*b)*Log[Tan[e + f*x]])/(a^3*f) - ((3*a -
2*b)*b^2*Log[a + b*Tan[e + f*x]^2])/(2*a^3*(a - b)^2*f) + b^2/(2*a^2*(a - b)*f*(a + b*Tan[e + f*x]^2))

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\cot ^3(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^3 \left (1+x^2\right ) \left (a+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{x^2 (1+x) (a+b x)^2} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {1}{a^2 x^2}+\frac {-a-2 b}{a^3 x}+\frac {1}{(a-b)^2 (1+x)}-\frac {b^3}{a^2 (a-b) (a+b x)^2}-\frac {(3 a-2 b) b^3}{a^3 (a-b)^2 (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac {\cot ^2(e+f x)}{2 a^2 f}-\frac {\log (\cos (e+f x))}{(a-b)^2 f}-\frac {(a+2 b) \log (\tan (e+f x))}{a^3 f}-\frac {(3 a-2 b) b^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 (a-b)^2 f}+\frac {b^2}{2 a^2 (a-b) f \left (a+b \tan ^2(e+f x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.88, size = 98, normalized size = 0.74 \[ -\frac {\frac {b^3}{a^3 (a-b) \left (a \cot ^2(e+f x)+b\right )}+\frac {b^2 (3 a-2 b) \log \left (a \cot ^2(e+f x)+b\right )}{a^3 (a-b)^2}+\frac {\cot ^2(e+f x)}{a^2}+\frac {2 \log (\sin (e+f x))}{(a-b)^2}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^3/(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-1/2*(Cot[e + f*x]^2/a^2 + b^3/(a^3*(a - b)*(b + a*Cot[e + f*x]^2)) + ((3*a - 2*b)*b^2*Log[b + a*Cot[e + f*x]^
2])/(a^3*(a - b)^2) + (2*Log[Sin[e + f*x]])/(a - b)^2)/f

________________________________________________________________________________________

fricas [B]  time = 0.49, size = 292, normalized size = 2.21 \[ -\frac {{\left (a^{3} b - 2 \, a^{2} b^{2} + 2 \, a b^{3}\right )} \tan \left (f x + e\right )^{4} + a^{4} - 2 \, a^{3} b + a^{2} b^{2} + {\left (a^{4} - a^{3} b - a^{2} b^{2} + 2 \, a b^{3}\right )} \tan \left (f x + e\right )^{2} + {\left ({\left (a^{3} b - 3 \, a b^{3} + 2 \, b^{4}\right )} \tan \left (f x + e\right )^{4} + {\left (a^{4} - 3 \, a^{2} b^{2} + 2 \, a b^{3}\right )} \tan \left (f x + e\right )^{2}\right )} \log \left (\frac {\tan \left (f x + e\right )^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) + {\left ({\left (3 \, a b^{3} - 2 \, b^{4}\right )} \tan \left (f x + e\right )^{4} + {\left (3 \, a^{2} b^{2} - 2 \, a b^{3}\right )} \tan \left (f x + e\right )^{2}\right )} \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left ({\left (a^{5} b - 2 \, a^{4} b^{2} + a^{3} b^{3}\right )} f \tan \left (f x + e\right )^{4} + {\left (a^{6} - 2 \, a^{5} b + a^{4} b^{2}\right )} f \tan \left (f x + e\right )^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/2*((a^3*b - 2*a^2*b^2 + 2*a*b^3)*tan(f*x + e)^4 + a^4 - 2*a^3*b + a^2*b^2 + (a^4 - a^3*b - a^2*b^2 + 2*a*b^
3)*tan(f*x + e)^2 + ((a^3*b - 3*a*b^3 + 2*b^4)*tan(f*x + e)^4 + (a^4 - 3*a^2*b^2 + 2*a*b^3)*tan(f*x + e)^2)*lo
g(tan(f*x + e)^2/(tan(f*x + e)^2 + 1)) + ((3*a*b^3 - 2*b^4)*tan(f*x + e)^4 + (3*a^2*b^2 - 2*a*b^3)*tan(f*x + e
)^2)*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)))/((a^5*b - 2*a^4*b^2 + a^3*b^3)*f*tan(f*x + e)^4 + (a^6
- 2*a^5*b + a^4*b^2)*f*tan(f*x + e)^2)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(-(1-cos(f*x+e
xp(1)))/(1+cos(f*x+exp(1)))*1/16/a^2+(4*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^3*a^4+12*((1-cos(f*x+exp(1))
)/(1+cos(f*x+exp(1))))^3*a^2*b^2-8*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^3*a*b^3-11*((1-cos(f*x+exp(1)))/(
1+cos(f*x+exp(1))))^2*a^4+22*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a^3*b-27*((1-cos(f*x+exp(1)))/(1+cos(
f*x+exp(1))))^2*a^2*b^2+16*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a*b^3+16*((1-cos(f*x+exp(1)))/(1+cos(f*
x+exp(1))))^2*b^4+10*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a^4-24*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a^
3*b+42*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a^2*b^2-20*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a*b^3-3*a^4+
6*a^3*b-3*a^2*b^2)/(48*a^5-96*a^4*b+48*a^3*b^2)/(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^3*a-2*((1-cos(f*x+e
xp(1)))/(1+cos(f*x+exp(1))))^2*a+4*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*b+(1-cos(f*x+exp(1)))/(1+cos(f*
x+exp(1)))*a)+1/(2*a^2-4*a*b+2*b^2)*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))+(-a-2*b)*1/4/a^3*ln(abs
(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1))))+(-3*a*b^2+2*b^3)/(4*a^5-8*a^4*b+4*a^3*b^2)*ln(((1-cos(f*x+exp(1)))
/(1+cos(f*x+exp(1))))^2*a-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))
)*b+a))

________________________________________________________________________________________

maple [A]  time = 1.00, size = 234, normalized size = 1.77 \[ -\frac {b^{3}}{2 f \,a^{2} \left (a -b \right )^{2} \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}-\frac {3 b^{2} \ln \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}{2 f \,a^{2} \left (a -b \right )^{2}}+\frac {b^{3} \ln \left (a \left (\cos ^{2}\left (f x +e \right )\right )-\left (\cos ^{2}\left (f x +e \right )\right ) b +b \right )}{f \,a^{3} \left (a -b \right )^{2}}+\frac {1}{4 f \,a^{2} \left (-1+\cos \left (f x +e \right )\right )}-\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 f \,a^{2}}-\frac {\ln \left (-1+\cos \left (f x +e \right )\right ) b}{f \,a^{3}}-\frac {1}{4 f \,a^{2} \left (1+\cos \left (f x +e \right )\right )}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 f \,a^{2}}-\frac {\ln \left (1+\cos \left (f x +e \right )\right ) b}{f \,a^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x)

[Out]

-1/2/f*b^3/a^2/(a-b)^2/(a*cos(f*x+e)^2-cos(f*x+e)^2*b+b)-3/2/f*b^2/a^2/(a-b)^2*ln(a*cos(f*x+e)^2-cos(f*x+e)^2*
b+b)+1/f*b^3/a^3/(a-b)^2*ln(a*cos(f*x+e)^2-cos(f*x+e)^2*b+b)+1/4/f/a^2/(-1+cos(f*x+e))-1/2/f/a^2*ln(-1+cos(f*x
+e))-1/f/a^3*ln(-1+cos(f*x+e))*b-1/4/f/a^2/(1+cos(f*x+e))-1/2/f/a^2*ln(1+cos(f*x+e))-1/f/a^3*ln(1+cos(f*x+e))*
b

________________________________________________________________________________________

maxima [A]  time = 1.39, size = 187, normalized size = 1.42 \[ -\frac {\frac {{\left (3 \, a b^{2} - 2 \, b^{3}\right )} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{5} - 2 \, a^{4} b + a^{3} b^{2}} - \frac {a^{3} - 2 \, a^{2} b + a b^{2} - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - 2 \, b^{3}\right )} \sin \left (f x + e\right )^{2}}{{\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} \sin \left (f x + e\right )^{4} - {\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} \sin \left (f x + e\right )^{2}} + \frac {{\left (a + 2 \, b\right )} \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{3}}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^3/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/2*((3*a*b^2 - 2*b^3)*log(-(a - b)*sin(f*x + e)^2 + a)/(a^5 - 2*a^4*b + a^3*b^2) - (a^3 - 2*a^2*b + a*b^2 -
(a^3 - 3*a^2*b + 3*a*b^2 - 2*b^3)*sin(f*x + e)^2)/((a^5 - 3*a^4*b + 3*a^3*b^2 - a^2*b^3)*sin(f*x + e)^4 - (a^5
 - 2*a^4*b + a^3*b^2)*sin(f*x + e)^2) + (a + 2*b)*log(sin(f*x + e)^2)/a^3)/f

________________________________________________________________________________________

mupad [B]  time = 11.88, size = 144, normalized size = 1.09 \[ \frac {\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )\,\left (\frac {b}{a^3}+\frac {1}{2\,a^2}-\frac {1}{2\,{\left (a-b\right )}^2}\right )}{f}-\frac {\frac {1}{2\,a}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (a\,b-2\,b^2\right )}{2\,a^2\,\left (a-b\right )}}{f\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^4+a\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}+\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f\,{\left (a-b\right )}^2}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a+2\,b\right )}{a^3\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^3/(a + b*tan(e + f*x)^2)^2,x)

[Out]

(log(a + b*tan(e + f*x)^2)*(b/a^3 + 1/(2*a^2) - 1/(2*(a - b)^2)))/f - (1/(2*a) + (tan(e + f*x)^2*(a*b - 2*b^2)
)/(2*a^2*(a - b)))/(f*(a*tan(e + f*x)^2 + b*tan(e + f*x)^4)) + log(tan(e + f*x)^2 + 1)/(2*f*(a - b)^2) - (log(
tan(e + f*x))*(a + 2*b))/(a^3*f)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**3/(a+b*tan(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________